package com.vogue.supplymall.account.domain.service.impl;

import java.util.Date;

import org.springframework.stereotype.Service;
import com.vogue.ssm.database.dao.BaseDao;
import com.vogue.supplymall.account.domain.dao.RegistinfoDao;
import com.vogue.supplymall.account.domain.model.BaseRegistinfo;
import com.vogue.supplymall.account.domain.service.BaseRegistinfoService;

@Service("baseRegistinfoService")
public class BaseRegistinfoServiceImpl extends BaseServiceImpl<BaseRegistinfo, Long> implements BaseRegistinfoService{

	@SuppressWarnings("unused")
	private RegistinfoDao registinfoDao;
	
	public BaseRegistinfoServiceImpl(BaseDao<BaseRegistinfo, Long> baseDao) {
        super(baseDao);
        registinfoDao=(RegistinfoDao)baseDao;
	}

	@Override
	public String findTelBySysCodeId(Long sysCodeId) {
		String tel="";
		BaseRegistinfo info = this.selectOneByWhr(String.format("syscodeid=%d ", sysCodeId));
		if(info!=null) {
			tel=info.getRegistinfo();
		}
		return tel;
	}

	@Override
	public void insertRegistName(Long sysCodeId, String registName) {
		BaseRegistinfo info = this.selectOneByWhr(String.format("syscodeid=%d", sysCodeId));
		if(info!=null) {
			info.setRegistname(registName);
			info.setModifyDate(new Date());
			registinfoDao.update(info);
		}
	
	}
	
	
}
